/* LOC - Decompiled by JCavaj
 * Visit http://www.bysoft.se/sureshot/jcavaj/
 */
package textui;
import jargs.gnu.CmdLineParser;

public class LOC
{
    public static void main(String[] strings) {
	CmdLineParser cmdlineparser = new CmdLineParser();
	CmdLineParser.Option option
	    = cmdlineparser.addBooleanOption('n', "nocomments");
	CmdLineParser.Option option_0_
	    = cmdlineparser.addStringOption('d', "directory");
	try {
	    cmdlineparser.parse(strings);
	} catch (CmdLineParser.OptionException optionexception) {
	    System.err.println(optionexception.getMessage());
	    printUsage();
	    System.exit(2);
	}
	boolean bool = cmdlineparser.getOptionValue(option) == null;
	String string = (String) cmdlineparser.getOptionValue(option_0_);
	String[] strings_1_ = cmdlineparser.getRemainingArgs();
	if (strings_1_.length > 0) {
	    SingleLOC singleloc = new SingleLOC(bool, string);
	    singleloc.countLines(strings_1_[0]);
	} else {
	    MultiLOC multiloc = new MultiLOC(bool, string);
	    multiloc.countLines();
	}
    }
    
    private static void printUsage() {
	System.err.println("Usage: ");
	System.err.println("Single File LOC count (Unix): ");
	System.err
	    .println("  java -cp LOC.jar:Model/jargs.jar textui.LOC <file>");
	System.err.println(" ");
	System.err.println("Multiple File LOC count (Unix): ");
	System.err.println
	    ("  ls -1  | java -cp LOC.jar:Model/jargs.jar textui.LOC ");
	System.err.println
	    ("  ls -1 <path> | java -cp LOC.jar:Model/jargs.jar textui.LOC -d <path>");
	System.err.println
	    ("This usage is intended for use in a script for automated line counting of multiple files.");
    }
}
